<HTML><HEAD><TITLE>alldifferent(+Vars)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic_global)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>alldifferent(+Vars)</H1>
All members of Vars are different
<DL>
<DT><EM>Vars</EM></DT>
<DD>A collection (a la collection_to_list/2) of variables or integers
</DD>
</DL>
<H2>Description</H2>
    Constrains all elements of a collection to be pairwise different (and
    integral).  This is an implementation with the same semantics as the
    standard alldifferent/1 constraint, but with stronger propagation
    behaviour.  It checks for exhaustion of all sub-ranges of possible
    values.
    </P><P>
    Any input variables which do not already have finite bounds will
    be given default bounds of -10000000 to 10000000.</P>
<H2>Examples</H2>
<PRE>
    ?- length(Xs,5), Xs::1..4, alldifferent(Xs).
    no (more) solution.


    ?- [X1,X2]::1..2, [X3,X4,X5]::1..5, alldifferent([X1,X2,X3,X4,X5]).

    X1 = X1{[1, 2]}
    X2 = X2{[1, 2]}
    X3 = X3{[3..5]}
    X4 = X4{[3..5]}
    X5 = X5{[3..5]}

    Delayed goals:
        alldifferent([X1{[1, 2]}, X2{[1, 2]}], 1)
        alldifferent([X3{[3..5]}, X4{[3..5]}, X5{[3..5]}], 1)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/ic_symbolic/alldifferent-1.html">ic_symbolic : alldifferent / 1</A>, <A HREF="../../lib/fd_global/alldifferent-1.html">fd_global : alldifferent / 1</A>, <A HREF="../../lib/sd/alldifferent-1.html">sd : alldifferent / 1</A>, <A HREF="../../lib/fd/alldifferent-1.html">fd : alldifferent / 1</A>, <A HREF="../../lib/ic/alldifferent-1.html">ic : alldifferent / 1</A>, <A HREF="../../lib_public/ic_global_gac/alldifferent-1.html">ic_global_gac : alldifferent / 1</A>, <A HREF="../../lib/ic_global/alldifferent-2.html">alldifferent / 2</A>, <A HREF="../../lib/lists/collection_to_list-2.html">lists : collection_to_list / 2</A>
</BODY></HTML>
